
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn = 100;
const int mid = 50;
long long dp[maxn+10][maxn+10];
void init()
{	
	memset(dp,0,sizeof(dp));
	dp[1][mid] = 1;
	for(int i = 2;i<=50;i++)
	{
		for(int j = 1;j<=maxn;j++)
		{
			dp[i][j] = dp[i-1][j-1]+dp[i-1][j]+dp[i-1][j+1];
		}
	}
	
}
int main()
{
    init();
    int n;
    scanf("%d",&n);
    while(n--)
    {
        int x;
        scanf("%d",&x);
        long long ans = dp[x+1][mid];
       	printf("%I64d\n",ans);
    }
}
